home *** CD-ROM | disk | FTP | other *** search
- function mKill()
- {
- this._parent.mKillObject(this);
- }
- function mPhysics(interval)
- {
- var newPosX = this.intPosX + this.intVelX * interval;
- var newPosY = this.intPosY + this.intVelY * interval;
- this.intPosX = newPosX;
- this.intPosY = newPosY;
- }
- function mReset()
- {
- this.active = false;
- this.intGapX = 0;
- this.intPosX = 10000;
- this.intPosY = 0;
- this.intVelX = 0;
- this.defaultTime = 1;
- this.defaultBombSpeed = -20;
- }
- function mStepFrame(interval)
- {
- this.mPhysics();
- var oChar = this._parent.oChar;
- var dX = this.intPosX - (oChar.intPosX + this.intGapX);
- if(dX < 10 && !this.active)
- {
- this.sndRisa.start();
- this.active = true;
- this.timer = this.defaultTime;
- }
- if(this.active)
- {
- if(this.intPosX < 0.9 * this._parent.oWave.intFinish)
- {
- this.intPosX = oChar.intPosX + this.intGapX;
- this.timer--;
- if(this.timer == 0)
- {
- this.timer = this.defaultTime;
- this.mPushBomb();
- }
- }
- else
- {
- this.intVelX = 5;
- this.timer = this.defaultTime;
- }
- }
- }
- function mPushBomb()
- {
- this.oImage.oBrazo.play();
- }
- function mDropBomb()
- {
- var dX = this.intPosX - this._parent.oChar.intPosX;
- var dY = this.intPosY - this._parent.oChar.intPosY;
- var velX = this.defaultBombSpeed;
- var velY = velX * dY / dX;
- velX += this._parent.oChar.intVelX;
- this._parent.mNewObstacule(this.intPosX + 37,this.intPosY + 10,velX,velY,"bomb_01");
- }
- this.sndRisa = new Sound(this);
- this.sndRisa.attachSound("mojojojo.wav");
- this.mReset();
-